//
//  UIFont-Extension.swift
//  ShowDance
//
//  Created by 苏泊尔漫也要按时吃饭 on 2022/10/8.
//

import Foundation

extension UIFont {
    public class func display1() -> UIFont {
        return UIFont.outfitSemiBold(ofSize: 34.scaleH())
    }
    
    public class func display2() -> UIFont {
        return UIFont.outfitBlod(ofSize: 34.scaleH())
    }
    
    public class func display3() -> UIFont {
        return UIFont.outfitSemiBold(ofSize: 70.scaleH())
    }
    
    public class func title1() -> UIFont {
        return UIFont.outfitExtraBlod(ofSize: 25.scaleH())
    }
    
    public class func title2() -> UIFont {
        return UIFont.outfitExtraBlod(ofSize: 19.scaleH())
    }
    
    public class func title3() -> UIFont {
        return UIFont.outfitExtraBlod(ofSize: 18.scaleH())
    }
    
    public class func title4() -> UIFont {
        return UIFont.outfitBlod(ofSize: 17.scaleH())
    }
    
    public class func title5Blod() -> UIFont {
        return UIFont.outfitBlod(ofSize: 16.scaleH())
    }
    
    public class func title5SemiBlod() -> UIFont {
        return UIFont.outfitSemiBold(ofSize: 16.scaleH())
    }
    
    public class func title6Blod() -> UIFont {
        return UIFont.outfitBlod(ofSize: 15.scaleH())
    }
    
    public class func title6ExtraBlod() -> UIFont {
        return UIFont.outfitExtraBlod(ofSize: 15.scaleH())
    }
    
    public class func title6Medium() -> UIFont {
        return UIFont.outfitMedium(ofSize: 15.scaleH())
    }
    
    public class func buttonNormal() -> UIFont {
        return UIFont.outfitExtraBlod(ofSize: 17.scaleH())
    }
    
    public class func textDisplay() -> UIFont {
        return UIFont.outfitRegular(ofSize: 21.scaleH())
    }
    
    public class func textLight() -> UIFont {
        return UIFont.outfitLight(ofSize: 18.scaleH())
    }
    
    public class func textRegular() -> UIFont {
        return UIFont.outfitRegular(ofSize: 18.scaleH())
    }
    
    public class func noticeNormalRegula() -> UIFont {
        return UIFont.outfitRegular(ofSize: 15.scaleH())
    }
    
    public class func noticeSmallRegula() -> UIFont {
        return UIFont.outfitRegular(ofSize: 12.scaleH())
    }
    
    public class func noticeNormalSemiBo() -> UIFont {
        return UIFont.outfitMedium(ofSize: 15.scaleH())
    }
    
    public class func noticeSmall() -> UIFont {
        return UIFont.outfitSemiBold(ofSize: 12.scaleH())
    }
    
    public class func perfect() -> UIFont {
        return UIFont.passionOneRegular(ofSize: 24)
    }
}

extension UIFont {
    
    /// 快捷创建一个**Medium System Font**，因为UI使用此字体频率非常高
    /// - Parameter fontSize: 字体大小
    /// - Returns: UIFont对象
    public class func mediumFont(ofSize fontSize: CGFloat) -> UIFont {
        return UIFont.systemFont(ofSize: fontSize, weight:UIFont.Weight.medium)
    }
    
    /// 快捷创建一个**Semibold System Font**，因为UI使用此字体频率非常高
    /// - Parameter fontSize: 字体大小
    /// - Returns: UIFont对象
    public class func semiboldFont(ofSize fontSize: CGFloat) -> UIFont {
        return UIFont.systemFont(ofSize: fontSize, weight:UIFont.Weight.semibold)
    }
    
    public class func outfitBlack(ofSize fontsize: CGFloat) -> UIFont {
        return UIFont(name: "Outfit-Black", size: fontsize)!
    }
    public class func outfitBlod(ofSize fontsize: CGFloat) -> UIFont {
        return UIFont(name: "Outfit-Bold", size: fontsize)!
    }
    public class func outfitExtraLight(ofSize fontsize: CGFloat) -> UIFont {
        return UIFont(name: "Outfit-ExtraLight", size: fontsize)!
    }
    public class func outfitExtraBlod(ofSize fontsize: CGFloat) -> UIFont {
        return UIFont(name: "Outfit-ExtraBold", size: fontsize)!
    }
    public class func outfitLight(ofSize fontsize: CGFloat) -> UIFont {
        return UIFont(name: "Outfit-Light", size: fontsize)!
    }
    public class func outfitMedium(ofSize fontsize: CGFloat) -> UIFont {
        return UIFont(name: "Outfit-Medium", size: fontsize)!
    }
    public class func outfitRegular(ofSize fontsize: CGFloat) -> UIFont {
        return UIFont(name: "Outfit-Regular", size: fontsize)!
    }
    public class func outfitSemiBold(ofSize fontsize: CGFloat) -> UIFont {
        return UIFont(name: "Outfit-SemiBold", size: fontsize)!
    }
    public class func outfitThin(ofSize fontsize: CGFloat) -> UIFont {
        return UIFont(name: "Outfit-Thin", size: fontsize)!
    }
    
    public class func passionOneRegular(ofSize fontsize: CGFloat) -> UIFont {
        return UIFont(name: "PassionOne-Regular", size: fontsize)!
    }
}


/// 快捷创建一个**Medium System Font**，因为UI使用此字体频率非常高
/// - Parameter fontSize: fontSize: 字体大小
/// - Returns: UIFont对象
public func MediumFont(_ fontSize: CGFloat) -> UIFont {
    return UIFont.mediumFont(ofSize: fontSize)
}

/// 快捷创建一个**Semibold System Font**，因为UI使用此字体频率非常高
/// - Parameter fontSize: 字体大小
/// - Returns: UIFont对象
public func SemiboldFont(_ fontSize: CGFloat) -> UIFont {
    return UIFont.semiboldFont(ofSize: fontSize)
}

/// 快捷创建一个**System Font**，因为UI使用此字体频率非常高
/// - Parameter fontSize: 字体大小
/// - Returns: UIFont对象
public func SystemFont(_ fontSize: CGFloat) -> UIFont {
    return UIFont.systemFont(ofSize: fontSize)
}
